if SERVER then
	registerCommand("speed", "Turn on/off great speed on the player you specify - defaults to yourself if you don't choose a player", function(param)
		local speedOn = "caller gave target speed"
		local speedOff = "caller took speed from target"
		if param["settings"]["speed_msg_on"] then
			speedOn = param["settings"]["speed_msg_on"]
		end
		if param["settings"]["speed_msg_off"] then
			speedOff = param["settings"]["speed_msg_off"]
		end
		local speedTable = {}
		speedTable["caller"] = getCaller(param[1])
		local targs = string.Explode(" ", param[3])
		if targs[1] == "all" then
			targs = player.GetAll()
		end
		local plyTarg = 0
		for i, targ in pairs(targs) do
			if (not targ) || targ == "" then
				if not param[1]:IsValid() then
					break
				end
				plyTarg = param[1]
			else
				plyTarg = getPlayerByName(targ)
			end
			if plyTarg then
				speedTable["target"] = plyTarg:GetName()
				if (not plyTarg["moocow_speed"]) || plyTarg["moocow_speed"] == -1 then
					display(param[1], "speed", { plyTarg }, parseDisplayMessage(speedOn, speedTable))
					plyTarg["moocow_speed"] = 1
					GAMEMODE:SetPlayerSpeed(plyTarg, 500, 3000)
				else
					display(param[1], "speed", { plyTarg }, parseDisplayMessage(speedOff, speedTable))
					plyTarg["moocow_speed"] = -1
					GAMEMODE:SetPlayerSpeed(plyTarg, 250, 500)
				end
			end
		end
	end)
	
	local function endSpeed(victim, weapon, killer) //Tried to get it to reset speed on spawn, didn't work - So I reset state instead
		if victim["moocow_speed"] == 1 then
			victim["moocow_speed"] = -1
		end
	end
	hook.Add("PlayerDeath", "moocow_endSpeed", endSpeed)
end